package yc.tool.dbmigrate;

import java.io.File;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import yc.tool.dbmigrate.service.MigreateCore;
import yc.tool.dbmigrate.service.MigreateService;



/**
 * 数据库同步主类
 * @author yuancan
 *
 */
public class StartMigrate {
	
	public static void main(String[] args) {
		
		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		if (args.length == 0) {
			//得到类的实例
//			MigreateCore ent01 = (MigreateCore) context.getBean(MigreateCore.class);
			MigreateService ent02 = (MigreateService) context.getBean(MigreateService.class);
//			ent01.test();
//			ent01.testSelectSqlserver();
//			System.out.println("--------------------");
//			ent01.testSelectOracl();
//			System.out.println("--------------------");
//			ent01.testInsertOracl();
//			ent01.testBatInster();
//			System.out.println("--------------------");
//			ent01.testSqlserverToOracle();
			
//			ent01.dbMigrate();
			try {
				ent02.init();
				ent02.dbMigrate();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		ClassPathXmlApplicationContext en = (ClassPathXmlApplicationContext)context;
        en.close();

	}

}
